package com.niit.main;

import com.niit.entity.Student;
import com.niit.util.MybatisUtil;
import java.util.List;
import org.apache.ibatis.session.SqlSession;

/**
 * 根据性别查询学生列表-映射SQL语句时使用#{}表达式和${}表达式
 *
 * @author hanliang
 */
public class Test03_04_GetByGender {

//    public static void main(String[] args) {
//
//        String gender = "女";
//
//        List<Student> list1 = null;
//        List<Student> list2 = null;
//
//		try (SqlSession session = MybatisUtil.openSession()) {
//			System.out.println("-----------------------------------------------------------------------------------------------------------------------------------------");
//			list1 = session.selectList("getStudentListByGender1", gender);
//			System.out.println("-----------------------------------------------------------------------------------------------------------------------------------------");
//			list2 = session.selectList("getStudentListByGender2", gender);
//		}
//
//		System.out.println("-----------------------------------------------------------------------------------------------------------------------------------------");
//		System.out.println("getStudentListByGender1查询的记录数："+list1.size());
//		System.out.println("getStudentListByGender2查询的记录数："+list2.size());
//		System.out.println("-----------------------------------------------------------------------------------------------------------------------------------------");
//    }
}
